package com.zyx.javademo.collection.set;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Yaxi.Zhang
 * @since 2021/6/16 14:15
 * desc:
 */
public class AddAllDemo {
    public static void main(String[] args) {
        Set<String> setA = new HashSet<>();
        setA.add("a1");
        setA.add("a2");
        setA.add("a3");
        Set<String> setB = new HashSet<>();
        setB.add("a2");
        setB.add("a3");
        setB.add("a4");
        setA.addAll(setB);
        System.out.println(setA);
    }
}
